package com.baoyouqun.service;

import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baoyouqun.domain.CreateCmd.RoleCreateCmd;
import com.baoyouqun.domain.Query.RoleQuery;
import com.baoyouqun.domain.UpdateCmd.RoleUpdateCmd;
import com.baoyouqun.domain.VO.RoleVO;
import com.baoyouqun.entity.Role;

import java.util.List;


public interface RoleService extends IService<Role> {

    boolean checkRoleCodeUnique(String roleCode);

    /**
     * 新增并返回实体
     */
    SingleResponse<RoleVO> create(RoleCreateCmd cmd);

    Response update(RoleUpdateCmd cmd);

    /**
     * 根据ID查询VO
     */
    RoleVO selectById(String id);

    /**
     * 分页查询VO
     */
    IPage<RoleVO> pageVo(RoleQuery query);    // 新增方法：根据角色ID列表查询权限

    List<String> getPermissionsByRoleIds(List<String> roleIds);

    SingleResponse<List<RoleVO>> getRoleList();
}